Skip to content

Conversation

Gao-Jun
Copy link
Contributor

@Gao-Jun Gao-Jun commented Apr 3, 2025

Background

Recently, I'm working on an SSE client to Tencent LKE interface, which use a POST request and reply SSE AIGC content. ruby-eventsource is a good gem to handle SSE replies, but cannot send request via POST.

Solution

This PR add a new param payload to initialize method. Some behaviors will be changed if payload is set.

  1. Request will be sent via HTTP POST method with payload content
  2. Reconnection is disabled to avoid duplicated POST

@Gao-Jun Gao-Jun requested a review from a team as a code owner April 3, 2025 08:14
@Gao-Jun Gao-Jun changed the title Add ability to POST an SSE request feat: Add ability to POST an SSE request Apr 3, 2025
@keelerm84
Copy link
Member

Thank you for your interest and contribution. I do not have the capacity to review this PR quite yet, but I will get to it ASAP.

@aunghtain
Copy link

i need this feature as well. when will it get merged? Thanks

@ShreyanJain9
Copy link

Hi! I also am working on something that could really benefit from this feature, thanks ^^

@saada
Copy link
Contributor

saada commented Aug 14, 2025

Went ahead and added support for PUT method as well: #64

Can we get a review on both PRs @keelerm84 if possible so we can get these features out?

@keelerm84 keelerm84 changed the title feat: Add ability to POST an SSE request feat: Add ability to control SSE request method and body Aug 15, 2025
@keelerm84
Copy link
Member

@Gao-Jun and @saada I have made some modifications to this PR.

Instead of inferring the method from the presence of a payload, we are making those 2 separately provided items. This is more inline with some of our other event source SDKs.

Additionally, the request payload can be either a simple static value, or the result of a executing some payload function.

In a separate PR, I will introduce the ability to disable the retry functionality, which I also think should be explicitly defined rather than inferred.

@keelerm84 keelerm84 merged commit 7c65c4b into launchdarkly:main Aug 18, 2025
6 checks passed
@Gao-Jun
Copy link
Contributor Author

Gao-Jun commented Aug 19, 2025

@keelerm84 Thank you for your work.
In the origin PR, when a POST request is closed, reconnection is disabled. code
And this is not included in the final commits.
Should we add this feature, or add a flag to handle this?

@keelerm84
Copy link
Member

@keelerm84 In the origin PR, when a POST request is closed, reconnection is disabled. code And this is not included in the final commits. Should we add this feature, or add a flag to handle this?

I had mentioned above I would make a separate PR for that. Sorry I didn't have time to do it previously, but I have just merged it here.

keelerm84 pushed a commit that referenced this pull request Sep 4, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.3.0](2.2.6...2.3.0)
(2025-08-28)


### Features

* Add ability to control SSE request method and body
([#51](#51))
([7c65c4b](7c65c4b))
* Add ability to disable retries
([#67](#67))
([f272b90](f272b90))
* Allow providing HTTP client option settings
([#68](#68))
([1d9b31c](1d9b31c))


### Bug Fixes

* Handle redirect on 301 and 307
([7d342e7](7d342e7))
* Pass through proxy user and password if present
([#69](#69))
([0bb36f3](0bb36f3))
* Support field without colon in event
([7d342e7](7d342e7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants